package com.controller.admin;

import com.service.EsInitService;
import config.MqConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class EsInitController {
    @Autowired
    private EsInitService esInitService;

    // 创建索引与mapping
    @RequestMapping("/esinit")
    @ResponseBody
    public String esInit(){
        esInitService.init(MqConfig.ES_MQ_DEMO);
        return "es create index and mapping  ok";
    }
}
